package com.ruoyi.business.service.market;

import com.ruoyi.base.service.BaseService;
import com.ruoyi.business.cache.market.MarketPublishManager;
import com.ruoyi.business.enums.market.MarketTypeEnum;
import com.ruoyi.business.pojo.market.MarketCacheDTO;
import com.ruoyi.business.pojo.market.MarketCacheQuery;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 市场
 *
 * @author lcf
 */
@Service
public class MarketService extends BaseService {
    /**
     * 发布
     */
    public void publish(MarketCacheQuery query, MarketTypeEnum typeEnum) {
        MarketPublishManager.add(query, typeEnum);
    }

    /**
     * 删除
     */
    public void del(String uuid, MarketTypeEnum typeEnum) {
        MarketPublishManager.del(uuid, typeEnum);
    }

    /**
     * 查看列表
     */
    public List<MarketCacheDTO> getList(String keyword, String galaxy, String nickName, MarketTypeEnum typeEnum) {
        return MarketPublishManager.getList(keyword, galaxy, nickName, typeEnum);
    }

    /**
     * 查看详情
     */
    public MarketCacheDTO getDetail(String id, MarketTypeEnum typeEnum) {
        return MarketPublishManager.getDetail(id, typeEnum);
    }
}
